<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>注册用户</title>
</head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function yanzheng(){
	var consumerpwd=document.getElementById("consumerpwd");
	var querenmima=document.getElementById("querenmima");
	var ref=/^[a-zA-Z0-9]{4,16}$/;
	if(!ref.test($("#consumername").val())){
	alert("用户名只能是字母和数字，必须在4到16位之间");
	return false;
	}
	if(!ref.test($("#consumerpwd").val())){
	alert("密码只能是字母和数字，必须在4到16位之间");
	return false;
	}
	if(querenmima=consumerpwd){
	alert("请确认两次输入的密码一致,并且都不能为空");
	return false;
	}
	var ref1=/^\S+$/;
	if(!ref1.test($("#realname").val())){
	alert("姓名不能为空");
	return false;
	}
	var ref2=/^\d{17}([0-9]|X)$/;
	if(!ref2.test($("#consumeridcard").val())){
	alert("请输入正确的身份证");
	return false;
	}
	var ref3=/^(1(([35][0-9])|(47)|[8][01236789]))\d{8}$/;
	if(!ref3.test($("#consumerphone").val())){
	alert("请您填写真实的手机号码，以便我们能及时联系到您！");
	return false;
	}
	var ref4=/^(0-9){1-120}$/;
	if(!ref4.test($("#consumerage").val())){
	alert("请输入正确年龄");
	return false;
	}
	var ref5=/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.a-zA-Z_-+)+$/;
	if(!ref5.test($("#consumeremail").val())){
	alert("请输入正确的邮件号，以便我们能及时联系到您！");
	return false;
	}
	return true;
	}
</script>

<style type="text/css">
   	#top{width:100%;
	height:150px;
	background-color:#39F}
	#middle{height:350px;
	width:100%;
	}
	#zuo{background-color:#FFF;
	width:25%;height:350px;
	float:left;}
	#zhong{background-color:#FFF;
	width:75%;height:350px;
	float:left;
	margin-top: 5%;
	}

	#bottom{width:100%;
	height:200px;
	float:none;
	}
	#zong{margin:2% 20% 2% 20%}
 	#ziti{
		color:#333}
body{
color: #03C;
}		
 </style>

<body>
<div  id="zong">

	<div id="top"><img src="images/uertitle.jpg" width="100%"/></div>
	<div id="middle">
      	<div id="zuo">

        </div>
    <div id="zhong">
<form method="post" action="consumerreg" onsubmit="return yanzheng()">
<center>${msg }</center>
<h2 align="center">用户注册</h2>
<table width="100%" border="0">
  <tr>
    <th>用户名：</th>
    <td><input name="consumer.consumername" type="text" id="consumername"/></td>
  </tr>

  <tr>
    <th>密码：</th>
    <td><input name="consumer.consumerpwd" type="text" id="consumerpwd"/></td>
  </tr>
  <tr>
 	<th>确认密码：</th>
    <td><input name="querenmima" type="text" id="querenmima"/></td>
  </tr>
    <tr>
    <th>姓名：</th>
    <td><input name="consumer.realname" type="text" id="realname"/></td>
  </tr>
  
    <tr>
    <th>年龄：</th>
    <td><input name="consumer.consumerage" type="text" id="consumerage"/></td>
  </tr>
     <tr>
    <th>性别：</th>
    <td>
<input name="consumer.consumersex" type="radio" value="男" />男
<input name="consumer.consumersex" type="radio" value="女" />女
    </td>
  </tr>

    <tr>
    <th>身份证号：</th>
    <td><input name="consumer.consumeridcard" type="text" id="consumeridcard"/></td>
  </tr>
     <tr>
    <th>手机号码：</th>
    <td><input name="consumer.consumerphone" type="text" id="consumerphone" /></td>
    </tr>
  <tr>
    <th>Email:</th>
    <td><input name="consumer.consumeremail" type="text" id="consumeremail"/></td>
  </tr>
    <tr>
    <td align="center" colspan="2"><input type="submit"  value=" 注册  " style="font-size:20px; color:#FFF; background-image: url(images/lanseanniu.jpg);"/></td>
  </tr>
</table>
</form>
 </div>
    </div>
	<div id="bottom"><img src="images/dibain.jpg" width="100%"/></div>
</div>
</body>
</html>
